package chapter1

import "fmt"

type people struct {
	name string
	age int
}

func (p *people)tostring()  {
	fmt.Printf("%#v",p)
}

type student struct {
	people
	grade int
}

func Test1(){
	x:=100
	switch {
	case x>10:
		fmt.Println(1000)
		fallthrough
	case x>100:
		fmt.Println(100)
	default:
		fmt.Println(192)
	}
	f:=getfunc(100)
	f()
	m:=make(map[int]int)
	m[1]=10
	m[2]=20
	m[3]=30
	fmt.Println(m)
	delete(m,2)
	fmt.Println(m)
	fmt.Println("------------------------------")
	stu1:=student{}
	stu1.name="wang"
	stu1.age=10
	stu1.grade=9
	fmt.Println(stu1.people)
	fmt.Println("--------------------------------")
	stu1.tostring()
	fmt.Println("-------------------------------------")
}

func getfunc(x int)func(){
	return func() {
		fmt.Println(x)
	}
}